<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>7</cardCount>
<cardID>4120</cardID>
<listID>6277</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>function itemsMatch a,brepeat with i = 1 to the number of items in aput item i of a into xrepeat with j = 1 to the number of items in bif item j of b is x thenreturn trueexit itemsMatchend ifend repeatend repeatreturn falseend itemsMatchfunction passesFilter --for library type section (ALL is the only "TO")global doFilter, userName, userOpt, onLineif not doFilter thenreturn trueexit passesFilterend ifIf onLine then sendString "."put card field "after date" of card "filter on..." into adif ad is not empty thenconvert ad to secsget field "date"convert it to secsif it < ad thenreturn falseexit passesFilterend ifend ifput card field "keyword list" of card "filter on..." into keyFilterif keyFilter is not empty thenput false into foundItrepeat with i = 1 to the number of items in keyFilterput item i of keyFilter into thisKeyif (thisKey is in field "subject") or (thisKey is in field "message") thenput true into foundItexit repeatend ifend repeatif not foundIt thenreturn falseexit passesFilterend ifend ifreturn trueend passesFilterfunction findNext startAtset cursor to 4put the lockScreen into oldLSput the lockMessages into oldLMset lockScreen to trueset lockMessages to truepush cardif startAt is not empty then do "go to " & startAtput empty into returnValueput the number of cards into nrepeat while the number of this card < ngo to next cardif not passesFilter() then next repeatput the id of this card into returnValueexit repeatend repeatpop cardset lockScreen to oldLSset lockMessages to oldLMreturn returnValueend findNextfunction findPrev startAtset cursor to 4put the lockScreen into oldLSput the lockMessages into oldLMset lockScreen to trueset lockMessages to truepush cardif startAt is not empty then do "go to " & startAtput empty into returnValueif the short name of this card is not "master template" thengo to previous cardrepeat while the short name of this card is not "master template"if passesFilter() thenput the id of this card into returnValueexit repeatend ifgo to previous cardend repeatend ifpop cardset lockScreen to oldLSset lockMessages to oldLMreturn returnValueend findPrevon fileNameget dateToSecs(field "date")answer the short name of this stack && it with "OK"end fileName-- -- this is the section that should apear in each section's stack!-- Open/init card code:-- Override to do local initialization (remember to pass if approp.).on openCardglobal doingBackFields, nextFieldNum, onLine, crcFlgglobal lookingForput empty into lookingForset cursor to 4set lockScreen to truesend initFields to this cardset lockScreen to falseif onLine thensendString return & returnget short name of this cardif (word 1 of it <> "card") or (word 2 of it <> "id") thenif it is not empty then sendString it & returnend ifrepeat with i = 1 to the number of fieldsget the lockText of field iif isEditable(name of field i) and (not it) thennext repeatend ifif not the visible of field i then next repeatput short name of field i into nif (word 1 of n is not "Bkgnd") or ¬(word 2 of n is not "field") or (word 3 of n is not "id") thenget isLong("field " & i)if it then get n & ":" & returnelse get n & ": "else get emptyif sendWithAbort(it & field i) thensend abortOCexit openCardend ifend repeatrepeat with i = 1 to the number of card fieldsget the lockText of card field iif isEditable(name of card field i) and (not it) then next repeatif notThere(name of card field i) then next repeatif not the visible of card field i then next repeatput short name of card field i into nif (word 1 of n is not "card") or ¬(word 2 of n is not "field") or (word 3 of n is not "id") thenget isLong("card field " & i)if it then get n & ":" & returnelse get n & ": "else get emptyif sendWithAbort(it & card field i) thensend abortOCexit openCardend ifend repeatif crcFlg then disCRCflushInputend ifput true into doingBackFieldsput 1 into nextFieldNumset cursor to 0end openCardfunction notThere fget the script of fif "-" & "- notThere" is in it then return trueelse return falseend notThere-- incase of aborton abortOCflushInputput true into doingBackFieldsput 1 into nextFieldNumset cursor to 0end abortOCon initFieldsglobal initFsif initFs thenrepeat with i = 1 to the number of fieldsif isEditable(name of field i) then put empty into field iend repeatrepeat with i = 1 to the number of card fieldsif isEditable(name of card field i) then put empty into card field iend repeatend ifend initFieldson displayFieldsend displayFieldson disCRCput 0 into theCRCrepeat with i = 1 to the number of fieldsget the lockText of field iif isEditable(name of field i) and (not it) then next repeatif not the visible of field i then next repeatput stringCRC(theCRC,field i) into theCRCend repeatrepeat with i = 1 to the number of card fieldsget the lockText of card field iif isEditable(name of card field i) and (not it) then next repeatif not the visible of card field i then next repeatput stringCRC(theCRC,card field i) into theCRCend repeatsendString return & ".C=" & theCRC & returnend disCRC-- Send text code:on sendString stringglobal onLineif onLine thenresetTimersendSPort stringend ifend sendStringon sendVanilla stringglobal onLineif onLine thenresetTimerconfigureSPort linefeedOffsendSPort stringconfigureSPort linefeedOnend ifend sendVanilla-- Field type testing code:function isEditable fget the script of fif "-" & "- editable" is in it then return trueelse return falseend isEditablefunction isLong fget the script of fif "-" & "- long" is in it then return trueelse return falseend isLongfunction isInvisible fget the script of fif "-" & "- invisible" is in it then return trueelse return falseend isInvisibleon stopNowglobal sysTOValput charsAvailable() into charCntif charCnt is not zero thenput recvChars(charCnt) into incomingif (numToChar(19) is in incoming) thenflushInputput the secs into wasrepeat while charsAvailable() is zeroif the secs > (was + sysTOVal) then exit repeatend repeatflushinputend ifend ifend stopNowfunction sendWithAbort theTextglobal sendAborted, sysTOValget theTextrepeat with i = 1 to the number of lines in itsendString line i of it & returnput charsAvailable() into charCntif charCnt is not zero thenput recvChars(charCnt) into incomingif (numToChar(3) is in incoming) or ¬(numToChar(15) is in incoming) or ¬(numToChar(24) is in incoming) thenput true into sendAbortedreturn trueexit sendWithAbortelseif (numToChar(19) is in incoming) thenflushInputput the secs into wasrepeat while charsAvailable() is zeroif the secs > (was + sysTOVal) then exit repeatend repeatflushinputend ifend ifend ifend repeatreturn falseend sendWithAborton promptFieldput short name of the target into nget word 1 of nif (it is "card") or (it is "Bkgnd") thenget (word 2 of n is not "field") or (word 3 of n is not "id")else get trueif it thenif isLong(the target) then put ":" & return after nelse put ": " after nsendString nend ifend promptFieldon lookingForNothingglobal doingBackFields, nextFieldNumif doingBackFields thenrepeatif nextFieldNum > the number of fields then exit repeatput nextFieldNum into iadd 1 to nextFieldNumget the lockText of field iif (not isEditable(name of field i)) or it then next repeatif not the visible of field i then next repeatput empty into field isend promptField to field iif isLong(name of field i) thensendString "[End with a period (.) on a line by itself]" & returnfillField name of field i,false,isInvisible(name of field i)else fillField name of field i,true,isInvisible(name of field i)exit lookingForNothingend repeatput false into doingBackFieldsput 1 into nextFieldNumend ifrepeatif nextFieldNum > the number of card fields then exit repeatput nextFieldNum into iadd 1 to nextFieldNumget the lockText of card field iif (not isEditable(name of card field i)) or it then next repeatif not the visible of card field i then next repeatput empty into card field isend promptField to card field iif isLong(name of card field i) thensendString "[End with a period (.) on a line by itself]" & returnfillField name of card field i,false,¬isInvisible(name of card field i)else fillField name of card field i,true,¬isInvisible(name of card field i)exit lookingForNothingend repeatsend cardFilled to this cardend lookingForNothing-- Button related code:on displayButtonsglobal onLine, errorCountif onLine thenflushInputput empty into textget ">> "repeat with i = 1 to the number of background buttonsif not the visible of background button i then next repeatput it & short name of background button i after textget ", "end repeatrepeat with i = 1 to the number of buttonsif not the visible of button i then next repeatput it & short name of button i after textget ", "end repeatif it is ", " thensendString text & ": "put 0 into errorCountlookFor "singleChar","pushButton"else send noButtons to this cardend ifend displayButtonson cardFilledsend displayButtons to this cardend cardFilled-- -- -- end of stuff to put in every stack</script>